// let modelUrl="https://www.youheguanjia.com/youhe-stu";//开发服务器apiServer
let modelUrl="https://www.youheguanjia.com/youhe-stu-test";//开发服务器apiServer
// let modelUrl="http://192.168.0.122:8082/youhe-stu";//正式服务器apiServer
let from ={'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}//from请求
let json={'Content-Type': 'application/json;charset=UTF-8'}//json请求
let loginUrl="./index.html#/"//token过期访问地址
export default {
    //获取token过期访问地址
    getLoginUrlPath:function(){
        return loginUrl
    },
    //获得API服务器路径
    getApiServerPath: function () {
        return modelUrl 
    },
    //获得API服务器路径
    getApiFrom: function () {
      
        if(JSON.parse(sessionStorage.getItem('from'))){
            return JSON.parse(sessionStorage.getItem('from'));
        }else{
            return from
        }
    },
    //获得API服务器路径
    getApiJson: function () {
        if(JSON.parse(sessionStorage.getItem('json'))){
            return JSON.parse(sessionStorage.getItem('json'));
        }else{
            return json
        }
         
    },
    setToken:function(token){
        json.token=token;
        from.token=token;
        sessionStorage.setItem('json',JSON.stringify(json));
        sessionStorage.setItem('from',JSON.stringify(from));
        
    },
    //获取Auther
    getAuther:function(parameter){
        return JSON.parse(sessionStorage.getItem(parameter));
    },
    //设置Auther
    setAuther:function(key,value){
        sessionStorage.setItem(key,JSON.stringify(value));
    }
}